home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / utility / ffe101.zip / GRAPH.SWG / 0005_GIF.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-04  |  4KB  |  80 lines

  1. --------I-GIF-------------------------------
  2.  
  3. The Graphics Interchange Format (tm) was created by Compuserve Inc. as a
  4. standard  for  the  storage and  transmission  of  raster-based graphics
  5. information,  i.e. images. A GIF file  may contain several images, which
  6. are  to  be  displayed  overlapping and  without  any  delay betwenn the
  7. images.  The image data itself is  compressed using a LZW scheme. Please
  8. note  that  the LZW algorithm is patented  by UniSys and that since Jan.
  9. 1995  royalties to Compuserve are due for every software that implements
  10. GIF  images.  The GIF file consists of  a global GIF header, one or more
  11. image blocks and optionally some GIF extensions.
  12.  
  13. OFFSET              Count TYPE   Description
  14. 0000h                   6 char   ID='GIF87a', ID='GIF89a'
  15.                                  This ID may be viewed as a version number
  16. 0006h                   1 word   Image width
  17. 0008h                   1 word   Image height
  18. 000Ah                   1 byte   bit mapped
  19.                                  0-2 - bits per pixel -1
  20.                                    3 - reserved
  21.                                  4-6 - bits of color resolution
  22.                                    7 - Global color map follows image descriptor
  23. 000Bh                   1 byte   Color index of screen background
  24. 000Ch                   1 byte   reserved
  25.  
  26. The  global color map immediately follows  the screen descriptor and has
  27. the size (2**BitsPerPixel), and has the RGB colors for each color index.
  28. 0  is none, 255 is full intensity. The bytes are stored in the following
  29. format :
  30.  
  31. OFFSET              Count TYPE   Description
  32. 0000h                   1 byte   Red component
  33. 0001h                   1 byte   Green component
  34. 0002h                   1 byte   Blue component
  35.  
  36. After the first picture, there may be more pictures attached in the file
  37. whic  overlay the first picture or parts of the first picture. The Image
  38. Descriptor  defines  the actual placement  and  extents of the following
  39. image  within  the  space defined in  the  Screen Descriptor. Each Image
  40. Descriptor  is  introduced by an image  separator character. The role of
  41. the  Image Separator is simply to provide a synchronization character to
  42. introduce  an  Image Descriptor, the image  separator is defined as ",",
  43. 02Ch, Any characters encountered between the end of a previous image and
  44. the image separator character are to be ignored.
  45.  
  46. The format of the Image descriptor looks like this :
  47.  
  48. OFFSET              Count TYPE   Description
  49. 0000h                   1 char   Image separator
  50.                                  ID=','
  51. 0001h                   1 word   Left offset of image
  52. 0003h                   1 word   Upper offset of image
  53. 0005h                   1 word   Width of image
  54. 0007h                   1 word   Height of image
  55. 0009h                   1 byte   Palette description - bitmapped
  56.                                  0-2 - Number of bits per pixel-1
  57.                                  3-5 - reserved (0)
  58.                                    6 - Interlaced / sequential image
  59.                                    7 - local / global color map, ignore bits 0-2
  60.  
  61. To  provide  for  some possibility of an  extension  of the GIF files, a
  62. special  extension  block  introducer can be  added  after  the GIF data
  63. block. The block has the following structure :
  64.  
  65. OFFSET              Count TYPE   Description
  66. 0000h                   1 char   ID='!'
  67. 0001h                   1 byte   Extension ID
  68. 0002h                   ? rec
  69.                         1 word   Byte count
  70.                         ? byte   Extra data
  71. ????h                   1 byte   Zero byte count - terminates extension
  72.                                  block.
  73.  
  74. EXTENSION:GIF
  75. OCCURENCES:PC
  76. PROGRAMS:CSHOW.EXE
  77. SEE ALSO:
  78. VALIDATION:
  79.  
  80.